package br.edu.fatec.ratoninja;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class Tile {
	private Bitmap bitmap;
	private Coordinates coordinates;
	private Rectangle rectangle;
	private char type;
	private boolean isPassable;
	
	public Tile(Bitmap pBitmap, Coordinates pCoordinates, boolean pIsPassable, char pType) {
		coordinates = pCoordinates;
		bitmap = pBitmap;
		isPassable = pIsPassable;
		type = pType;
		rectangle = new Rectangle(new Coordinates(coordinates.getX(), coordinates.getY()), bitmap.getWidth(),  bitmap.getHeight()); 
	}
	
	public void draw(Canvas canvas) {
		canvas.drawBitmap(bitmap, (float)coordinates.getX(), (float)coordinates.getY(), null);
	}
	
	public Bitmap getBitmap() {
		return bitmap;
	}

	public void setBitmap(Bitmap bitmapP) {
		bitmap = bitmapP;
	}

	public Coordinates getCoordinates() {
		return coordinates;
	}

	public void setCoordinates(Coordinates pCoordinates) {
		coordinates = pCoordinates;
	}

	public Rectangle getRectangle() {
		return rectangle;
	}
	
	public void setRectangle(Rectangle r) {
		rectangle = r;
	}
	
	public boolean isPassable() {
		return isPassable;
	}

	public void setPassable(boolean value) {
		isPassable = value;
	}

	public char getType() {
		return type;
	}

	public void setType(char bitmapType) {
		type = bitmapType;
	}
	
}
